package com.ryskoo.permission.manager.domain;

import com.ryskoo.framework.core.bean.BasicPO;
import com.ryskoo.permission.role.domain.RolePO;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;

/**
 * @author Shawn
 */
@Entity
@Table(name = "PMS_MANAGER")
public class ManagerPO extends BasicPO {
	private static final long serialVersionUID = -3889983146564775832L;
	/**
	 * 登录帐号
	 */
	@Column(name = "login_name", columnDefinition = "varchar", length = 20, nullable = false)
	private String loginName;
	/**
	 * 管理员密码
	 */
	@Column(name = "password", columnDefinition = "varchar", length = 40, nullable = false)
	private String password;
	/**
	 * 管理员姓名
	 */
	@Column(name = "name", columnDefinition = "varchar", length = 24, nullable = false)
	private String name;
	/**
	 * 状态
	 */
	@Column(name = "state", columnDefinition = "bit", length = 1)
	private boolean state = true;
	/**
	 * 身份
	 */
	@Column(name = "identity", columnDefinition = "varchar", length = 10)
	private String identity;
	/**
	 * 职位
	 */
	@Column(name = "position", columnDefinition = "varchar", length = 10)
	private String position;
	/**
	 * 手机号
	 */
	@Column(name = "mobile", columnDefinition = "tinyint", length = 20, nullable = false)
	private String mobile;
	/**
	 * 邮箱
	 */
	@Column(name = "email", columnDefinition = "varchar", length = 40)
	private String email;
	/**
	 * QQ
	 */
	@Column(name = "qq", columnDefinition = "varchar", length = 12)
	private Integer qq;
	/**
	 * 备注
	 */
	@Column(name = "description", columnDefinition = "varchar", length = 100)
	private String description;
	/**
	 * 部门uuid
	 */
	@Column(name = "dept_id", columnDefinition = "char", length = 32)
	private String deptId;
	/**
	 * 是否超级管理员
	 */
	@Column(name = "super_manager", columnDefinition = "bit", length = 1, nullable = false)
	private boolean superManager = false;

	/**
	 * 管理员所属部门名称，非持久化属性
	 */
	@Transient
	private String deptName;

	/**
	 * 管理员关联的角色列表，非持久化属性
	 */
	@Transient
	private List<RolePO> roleList;

	@Transient
	private boolean resetPassword;

	public String getLoginName() {
		return loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public boolean getState() {
		return state;
	}

	public void setState(boolean state) {
		this.state = state;
	}

	public String getIdentity() {
		return identity;
	}

	public void setIdentity(String identity) {
		this.identity = identity;
	}

	public String getPosition() {
		return position;
	}

	public void setPosition(String position) {
		this.position = position;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public Integer getQq() {
		return qq;
	}

	public void setQq(Integer qq) {
		this.qq = qq;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getDeptId() {
		return deptId;
	}

	public void setDeptId(String deptId) {
		this.deptId = deptId;
	}

	public boolean isSuperManager() {
		return superManager;
	}

	public void setSuperManager(boolean superManager) {
		this.superManager = superManager;
	}

	public String getDeptName() {
		return deptName;
	}

	public void setDeptName(String deptName) {
		this.deptName = deptName;
	}

	public List<RolePO> getRoleList() {
		return roleList;
	}

	public void setRoleList(List<RolePO> roleList) {
		this.roleList = roleList;
	}

    public boolean isResetPassword() {
        return resetPassword;
    }

    public void setResetPassword(boolean resetPassword) {
        this.resetPassword = resetPassword;
    }
}
